package us.quizgame;

import java.awt.EventQueue;
import java.awt.Point;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextPane;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import java.awt.Color;

public class Help extends JFrame {

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Help frame = new Help();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	private JPanel contentPane;

	/**
	 * Create the frame.
	 */
	public Help() {
		setResizable(false);
		setTitle("Welcome to the XTR3M3 Quiz Game!");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 550, 450);
		contentPane = new JPanel();
		contentPane.setBackground(Color.BLACK);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnDone = new JButton("Done");
		btnDone.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				
				//Exit Help menu
				Menu menu = new Menu();
				menu.setVisible(true);
				setVisible(false);
			}
		});
		btnDone.setBounds(10, 378, 514, 23);
		contentPane.add(btnDone);
		
		JTextPane txtHelp = new JTextPane();
		txtHelp.setEditable(false);
		txtHelp.setText("Welcome to the XTR3M3 Quiz Game!\r\n\r\nTo play, select either Start Game or Survival Mode from the main menu.\r\n\r\nThe normal version of the game is a timed quiz.  You will be asked 10 questions, and will have 5 seconds to answer each question.  Each question has two possible answers.  You can choose an answer by clicking on it, or by pressing the cooresponding key on the keyboard.  When you are finished with all X questions, you will be shown a score screen with your score and time, which you can submit to the High Scores list.\r\n\r\nSurvival Mode is a little different.  Instead of being given X questions to answer, you continue answering questions until you get one wrong.  However, if you get even one question wrong, the game will end right there.  When this happens, you will be shown a score screen with the total number of questions you answered and your time.  Like with the normal game, you can submit this to the High Scores list.\r\n\r\nYou also have the option of submitting your own questions to the database.  Keep in mind that if you supply inappropriate information, we will hunt you down.\r\n\r\nOnce you've finished a quiz, you can review your score by selecting the Score Card button from the main menu.");
		
		JScrollPane scrollPane = new JScrollPane(txtHelp);
		scrollPane.setBounds(10, 114, 514, 253);
		contentPane.add(scrollPane);
		
		//scrollPane.getVerticalScrollBar();
		System.out.println(scrollPane.getVerticalScrollBar().getValue());
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setIcon(new ImageIcon(Menu.class.getResource("/us/quizgame/images/av-20034.png")));
		lblNewLabel.setBounds(194, 6, 150, 99);
		
		contentPane.add(lblNewLabel);

	}
}
